package net.borlis.sample.services.facade.ws.response;

import net.borlis.dictionaries.product.DeprecatedProductType;
import net.borlis.sample.service.entities.general.TypedDynamixProviderEntity;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Created by alexander.borlis on 15.08.2014.
 */
@XmlRootElement
public class ProviderBean {

    @XmlElement(name = "name")
    private String name;

    @XmlElement(name = "code")
    private String code;

    @XmlElement(name = "type")
    private DeprecatedProductType type;

    public ProviderBean() {
    }

    public ProviderBean(TypedDynamixProviderEntity dynamixProviderEntity) {
        this.name = dynamixProviderEntity.getDynamixProvider().getCode();
        this.code = dynamixProviderEntity.getDynamixProvider().getCode();
        this.type = dynamixProviderEntity.getCombinedType().getProviderType().getType();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public DeprecatedProductType getType() {
        return type;
    }

    public void setType(DeprecatedProductType type) {
        this.type = type;
    }
}
